/*
 *   Copyright (c) 2010-2022, SIUFUNG
 */
package net.siufung.market.base.permit.mapper.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 系统角色表
 *
 * @author 陈建峰
 * @since 2022-07-05 16:14:50
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_role")
public class Role implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 角色名称
     */
    @TableField("role_name")
    @NotBlank(message = "角色名称不能为空!")
    @Length(max=32, message="角色名称长度不大于32!")
    private String roleName;

    /**
     * 角色编码
     */
    @TableField("role_code")
    @NotBlank(message = "角色编码不能为空!")
    @Length(max=32, message="角色编码长度不大于32!")
    private String roleCode;

    /**
     * 排序
     */
    @TableField("sequence")
    @NotNull(message = "排序不能为空!")
    private Integer sequence;

    /**
     * 描述
     */
    @TableField("description")
    @Length(max=255, message="描述长度不大于255!")
    private String description;

    /**
     * 租户
     */
    @TableField("tenant_id")
    private Integer tenantId;

    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 更新人
     */
    @TableField(value = "updated_by", fill = FieldFill.UPDATE)
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.UPDATE)
    private LocalDateTime updatedAt;

    /**
     * 数据标识
     */
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    private Boolean deleted;


}
